package com.qnw.CardGroupManagement.helper;
import android.database.sqlite.*;
import android.content.*;

public class CardCdbHelper extends SQLiteOpenHelper {
    private Context mContext;

    //我们希望创建一个名为BookStore.db的数据库, 然后在数据库中新建一张Book表, 其中有id(主键), 作者, 价格,页数和书名. SQL建表语句如下:
    /****
     *  integer: 表示整型;
     *  real: 表示浮点型;
     *  text: 表示文本型;
     *  blob:表示二进制类型
     *  primary key: 表示主键;
     *  autoincrement: 表示自增长
     */

    public static final String CREATE_DATAS = "create table datas (" +
	"id text primary key, " +
	"ot text, " +
	"alias text, " +
	"setcode text, " +
	"type text, " +
	"atk text, " +
	"def text, " +
	"level text, " +
	"race text, " +
	"attribute text, " +
	"category text)";

	public static final String CREATE_TEXTS = "create table texts (" +
	"id text primary key, " +
	"name text, " +
	"desc text, " +
	"str1 text, " +
	"str2 text, " +
	"str3 text, " +
	"str4 text, " +
	"str5 text, " +
	"str6 text, " +
	"str7 text, " +
	"str8 text, " +
	"str9 text, " +
	"str10 text, " +
	"str11 text, " +
	"str12 text, " +
	"str13 text, " +
	"str14 text, " +
	"str15 text, " +
	"str16 text)";
	
	
    public CardCdbHelper(Context context,String path, String name) {
        super(context, path+name, null, 1);
        mContext = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_DATAS);
		db.execSQL(CREATE_TEXTS);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
